/***************************************************************************
 创建者: 华磊
 开始时间: 2019.3.9
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file xx.h
 *  功能: qt modbus
 *
 *                                                                         *
 ***************************************************************************/
#ifndef MODBUSDEFINE_H
#define MODBUSDEFINE_H

#define D_MODBUS_REGISTER_SIZE 210

enum ModbusConnection {
    Serial,
    Tcp
};

enum READ_WRITE_RESULT_STATE
{
    READ_WRITE_RESULT_STATE_IDLE,
    READ_WRITE_RESULT_STATE_WAITING,
    READ_WRITE_RESULT_STATE_SUCCESS,
    READ_WRITE_RESULT_STATE_ERROR
};


struct RegisterSize
{
    int coilSize; //master can write and read
    int discreteInputSize;//master can  read
    int inputRegisterSize;//master can  read
    int holdingRegisterSize;//master can write and read
};


struct SerialSettings {
    int parity = 2;
    int baud = 9600;
    int dataBits = 8;
    int stopBits = 1;
    int responseTime = 1000;
    int numberOfRetries = 3;

};
//enum Parity {
//    NoParity = 0,
//    EvenParity = 2,
//    OddParity = 3,
//    SpaceParity = 4,
//    MarkParity = 5,
//    UnknownParity = -1
//};


#endif // MODBUSDEFINE_H
